#include "weapons.h"
#include "..\gameParameters.h"
#include "saw.h"
#include "fists.h"
#include "shotgun.h"
#include "shotgun2.h"
#include "minigun.h"

void Weapons::loadWeapons()
{
	//weapons[0] = new Saw(MD2Model::load(GameParameters::getWeaponsPath("saw.md2")));
	//weapons[0] = new Fists(MD2Model::load(GameParameters::getWeaponsPath("fists.md2")));
	weapons[0] = new Shotgun(MD2Model::load(GameParameters::getWeaponsPath("shotgun.md2")));
	weapons[1] = new Shotgun2(MD2Model::load(GameParameters::getWeaponsPath("shotgun2.md2")));
	weapons[2] = new Minigun(MD2Model::load(GameParameters::getWeaponsPath("minigun.md2")));
}

Weapon* Weapons::getWeapon(short i, bool hideAnimation)
{
	short noOfWeapons = sizeof(weapons)/sizeof(Weapon*);
	if (i > noOfWeapons)
		i = noOfWeapons;

	//tables always start from 0
	--i;

	if (i < 0)
		i = 0;

	if (hideAnimation)
		weapons[i]->pickWeapon();
		//weapons[i]->setAnimation(weapons[i]->getPickFrame(), weapons[i]->getSwayFrame(), true);
		//weapons[i]->setIsPicking(true);

	return weapons[i];
}

Weapon* Weapons::weapons[3];